<%-- 
    Document   : index
    Created on : Feb 25, 2012, 8:54:19 PM
    Author     : Jaice
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <link rel="stylesheet" href="style/style.css" type="text/css" id="" media="print, projection, screen" />
    <head>
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1" />
        <META Http-Equiv="Cache-Control" Content="no-cache"/>
        <META Http-Equiv="Cache-Control" Content="no-store"/>
        <META Http-Equiv="Pragma" Content="no-cache"/>
        <META Http-Equiv="Expires" Content="0"/>

        <%
            response.setHeader("Cache-Control", "no-cache, must-revalidate, no-store");
            response.setHeader("Pragma", "no-cache");
            response.setDateHeader("Expires", 0);

        %>
        <jsp:useBean id="SecprogScopeSession" class=
                     "servlets.SecprogScopeSession" scope="session" />
        <%
            if (SecprogScopeSession.getIsLogin()) {

        if (SecprogScopeSession.getAccounttype() == 1) {
            response.sendRedirect("../customer/CMain.jsp");
        } else if (SecprogScopeSession.getAccounttype() == 2) {
            response.sendRedirect("../accounting/ACMain.jsp");
        } else if (SecprogScopeSession.getAccounttype() == 3 ||SecprogScopeSession.getAccounttype() == 4||SecprogScopeSession.getAccounttype() == 5||SecprogScopeSession.getAccounttype() == 6 ) {
            response.sendRedirect("../product/PMain.jsp");
        } else if (SecprogScopeSession.getAccounttype() == 10) {
            response.sendRedirect("../admin/AMain.jsp");
        }
            }
        %>

    </head>
    <body bgcolor="#FFFACD">

        <table width="94%" border="0" align="center">

            <tr >
                <td style="background-color:#FFA500; height:100px">

                </td>
            </tr>

            <tr>
                <td align="center" style="padding-top:5%; padding-left:10%; padding-right:10%; padding-bottom:5%; background-color:#EEEEEE;height:auto;width:400px;">
            <a1>Login</a1><br></br>
            <form method="post" action="login/LoginProcess.jsp">

                <table align="center">

                    <tr>
                        <td><a50>Username : </a50></td>
                    <td><input type="text" id="userName" name="userName" autocomplete="off" />

                        <%
                            SecprogScopeSession.setCounter(SecprogScopeSession.getCounter() + 1);
                        %>



                    </td>
                    </tr>
                    <tr>
                        <td><a50>Password : </a50></td>
                    <td><input type="password" id="password" name="password"/> </td></tr>
                    <tr>
                        <td>
                            Counter value is <%= SecprogScopeSession.getCounter()%>
                        </td></tr>

                    <td colspan="1" align="left"><a href="register/registration.jsp"><font size="4" face="arial">Register</font></a> </td>
                    <td colspan="1" align="right"><input type="submit" value="Login"/></td>

                </table>
            </form>

        </td>
    </tr>

    <tr>
        <td colspan="2" style="background-color:#FFA500;text-align:center;">
            Copyright © 2011</td>
    </tr>
</table>

</body>
</html> 